// JavaScript Document
$(function () {
	initDetail();
});
//初始化
function initDetail(){
	getInfo(getQueryString("id"));
}
//获取详情
function getInfo(id){
	var str = 'crtpcUuid='+encodeURIComponent(id);
	getOData(str,"coreTaobaoPic/views",{fn:function(oData){
		console.log(oData);
		if(oData.code == 1) {
			$(".crtpcAccount").text(oData.data.crtpcAccount || "");
			$(".crtpcFile").text(oData.data.crtpcFile || "");
			$(".crtpcCdate").text(oData.data.crtpcCdate || "");
			$(".crtpcUdate").text(oData.data.crtpcUdate || "");
			/*var imgUrl="/"+oData.data.list[0].cratmDir+"/"+oData.data.list[0].cratmFileName;
			getImageWidthHeight(urlfile+"/coreAttachment/image/get/thumb/"+oData.data.list[0].cratmUuid,function(realWidth,realHeight){
				var width = 0;
				var height = 200;
				//如果真实的宽度大于浏览器的宽度就按照200显示
				if(realHeight>=height){
					width = realWidth/realHeight*height;
					$(".preimg").css("width",width).css("height",height);
				}else{//如果小于浏览器的宽度按照原尺寸显示}
					$(".preimg").css("width",realWidth+'px').css("height",realHeight+'px');
				}
				$(".preimg").attr("src",urlfile+"/coreAttachment/image/get/thumb/"+oData.data.list[0].cratmUuid);
				$(".preimg").attr("data-filename",imgUrl);
			});*/


			var uuids = oData.data.crtpcFileList;
			var html = "";
			var url = "";
			for(var i=0;i<uuids.length;i++) {
				url = urlfile + 'coreAttachment/image/get/other/'+uuids[i];
				html += '<img src="'+url+'" style="width: 200px;float: left;margin: 0px 10px 5px 0px;">';
			}
			
			// var html = '<img src="'+url+'" style="width: 200px;float: left;margin: 0px 10px 5px 0px;">'+
			// '<img src="'+url+'" style="width: 200px;float: left;margin: 0px 10px 5px 0px;">'+
			// '<img src="'+url+'" style="width: 200px;float: left;margin: 0px 10px 5px 0px;">';
			$("#allImges").html(html);
		} else {
			alert(data.errMsg);
		}
	}});
}
